package tianrun.ziguan.api.calculate.config.service.asset.callabel.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import org.springframework.stereotype.Service;
import tianrun.ziguan.api.calculate.config.dao.TAssetCalLabelConfigMapper;
import tianrun.ziguan.api.calculate.config.dto.response.TAssetCalLabelConfigVO;
import tianrun.ziguan.api.calculate.config.entity.TAssetCalLabelConfig;
import tianrun.ziguan.api.calculate.config.service.asset.callabel.ITAssetCalLabelConfigService;
import tianrun.ziguan.api.calculate.config.utils.CollectionUtil;

import java.util.Collection;
import java.util.List;

/**
 * @author zhaoqi
 */
@Service
public class TAssetCalLabelConfigServiceImpl extends ServiceImpl<TAssetCalLabelConfigMapper, TAssetCalLabelConfig> implements ITAssetCalLabelConfigService {

    @Override
    public List<TAssetCalLabelConfigVO> queryLabelListByAssetNums(Collection<String> assetNums, String tableName) {
        if (CollectionUtil.isEmpty(assetNums))return Lists.newArrayList();
        return baseMapper.queryLabelListByAssetNums(assetNums,tableName);
    }
    @Override
    public List<TAssetCalLabelConfigVO> queryLabelListByCalAssetIds(Collection<Long> ids, String tableName) {
        if (CollectionUtil.isEmpty(ids))return Lists.newArrayList();
        return baseMapper.queryLabelListByCalAssetIds(ids,tableName);
    }
}
